Release 10.1A: OpenEdge Development:
Progress 4GL Handbook


Overview of data handling statements

You have already been introduced to many of the 4GL statements that manage data, either by reading records from a data source and making them available to the application in record buffers or by displaying data to the screen and saving changes from the screen. The chart in Figure 15–1 summarizes the scope of each of these statements relative to these four layers of interaction:

Figure 15–1: Data handling statements

From the chart in Figure 15–1, you can see that some single statements span multiple layers in the system. This makes these statements very economical (in terms of syntax requirements) in a host-based or client/server system, but problematic in a distributed system where the user and the screen buffer do not exist in the same session with the database. This means that some of these statements are not of great use in a distributed application and, as a result, you rarely (if ever) use them. These include:

Each of these statements is implicitly (if not explicitly) followed by a record RELEASE that actually writes the record with its changes back to the database. The exact timing of that record release is discussed later in the "Making sure you release record locks" section, but this means that these statements carry data all the way from the user to the database. Since this can’t be done in a single session of a distributed application, you won’t generally use these statements with database tables.

When can you still use them? As you’ve already seen, Progress provides the temp-table as a way to present and manage a set of records independent of the database and, in particular, as the way you should pass data from server to client and back. So you could use any of these statements against a temp-table in the client session, because the Database Record layer is, in fact, just the temp-table record in the client session. In particular, opening a query against a client-side temp-table and seeing that query’s data in a related browse is the standard way to present tables of data on the client.

You’ve already seen the following statements in action:

There remain several new statements you’ll learn about in the next chapter. These include:

In addition to these transaction-oriented statements, the PROMPT-FOR statement enables a field in the screen buffer and lets the user enter a value for it. In an event-driven application, you do not normally want the user interface to wait on a single field and force the user to enter a value into that field before doing anything else, so the PROMPT-FOR statement is also not a frequent part of a modern application. The INSERT, SET, and UPDATE statements similarly have their own built-in WAIT-FOR, which demands input into the fields before the user can continue. For this reason, these statements are also of limited usefulness in an event-driven application, even when you are updating records in a client-side temp-table.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095